﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Assets.Script.BattleSystem.SyncModle
{
    public class SpaceInfo
    {
        public Vector3 pos;
        public Vector3 size;
        public float angle;//Z轴为轴心

        public SpaceInfo()
        {
            pos = new Vector3();
            size = new Vector3();
            angle = 0;
        }

        public SpaceInfo(Vector3 pos)
        {
            this.pos = pos;
            size = new Vector3(1,1,1);
            angle = 0;
        }

        public SpaceInfo(Vector3 pos, Vector3 size)
        {
            this.pos = pos;
            this.size = size;
            angle = 0;
        }

        public SpaceInfo(Vector3 pos, Vector3 size, float angle)
        {
            this.pos = pos;
            this.size = size;
            this.angle = angle;
        }

        public void MoveForTime(Vector3 speed,float time)
        {
            pos.x += speed.x * time;
            pos.y += speed.y * time;
            pos.z += speed.z * time;
        }


        public void Move(Vector3 value)
        {
            pos.x += value.x;
            pos.y += value.y;
            pos.z += value.z;
        }

        public override string ToString()
        {
            return $"{nameof(pos)}: {pos}, {nameof(size)}: {size}, {nameof(angle)}: {angle}";
        }
    }
}
